<ul>
    <li><a href="{:url('Loupan/detail',['id'=>$info['id']])}" {eq name='action' value='detail'}class="selected"{/eq} >楼盘主页</a></li>
    <li><a href="{:url('Loupan/news',['house_id'=>$info['id']])}" {eq name='action' value='news'}class="selected"{/eq} >楼盘动态</a></li>
    <li><a href="{:url('Loupan/type',['house_id'=>$info['id']])}" {if condition="$action eq 'type' or $action eq 'typeshow'"}class="selected"{/if}>全部户型</a></li>
    <li><a href="{:url('Loupan/pic',['house_id'=>$info['id']])}" {eq name='action' value='pic'}class="selected"{/eq}>楼盘相册</a></li>
    <li><a href="{:url('Loupan/peitao',['house_id'=>$info['id']])}" {eq name='action' value='peitao'}class="selected"{/eq}>周边配套</a></li>
    <li><a href="{:url('Loupan/info',['house_id'=>$info['id']])}" {eq name='action' value='info'}class="selected"{/eq}>楼盘信息</a></li>
    <li><a href="{:url('Loupan/question',['house_id'=>$info['id']])}" {eq name='action' value='question'}class="selected"{/eq}>楼盘问答</a></li>
</ul>
{if condition='$info.money gt 0 and $site.hongbao eq 1'}
<a href="javascript:;" id="linghongbao">
    <div class="hb-right">
        <p class="hb-p1">最高<strong>{$info.money}</strong>元</p>
        <p class="hb-p2">买新房 领红包 人人有份</p>
        <div class="detailPopClose"></div>
    </div>
</a>
<div class="red_shade" id="shade" style="display: none;">
    <div class="hongb red_common_width">
        <div class="red_price red_common_position">{$info.money}</div>
        <div class="red_title red_common_width red_common_position">{$info.title}</div>
        <a class="red_close" href="javascript:;" onclick="$('#shade').hide();" id="m_close"></a>
        <form id="hongbao_submit" method="post" action="{:url('Ajax/addOrder')}" name="formphp">
            <div class="red_form red_common_position">
                <p>请填写正确的信息领取优惠</p>
                <input id="red_name" name="name" placeholder="请输入姓名" type="text">
                <input id="red_phone" name="phone" placeholder="请输入手机号" type="text">
                <input type="hidden" name="type" value="5">
                <input type="hidden" name="house_id" value="{$info.id}">
                <input type="hidden" name="model" value="house">
                <input type="hidden" name="money" value="{$info.money}">
                <!--input style="width:100px;border-right:none;" id="red_code" placeholder="请输入验证码" type="text"><input id="btnSendCode" style="width:50px;cursor:pointer;color:#000;height:30px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;transition: all 0.2s ease-out 0s;" value="获取" type="button"-->
            </div>
            <a class="red_btn red_common_width red_common_position" id="add_red" href="javascript:;"><img src="__IMG__/submit_btn.png"></a>
        </form>
    </div>
</div>
{/if}
<script src="__PUBLIC__/js/plugins/jquery.ajax.form.js"></script>

<script>
    $(function(){
        $('.detailPopClose').bind('click',function(e){
            $(this).parent().hide();
            e.stopPropagation();
        });
        $('#linghongbao').bind('click',function(){
            $('#shade').show();
        });
        $('#add_red').bind('click',function(){
            var name = $('#red_name').val(),phone = $('#red_phone').val(),reg = /1[34578][0-9]{9}$/;
            if(name.length == 0){
                layer.msg('请填写您的姓名',{icon:2});
                return false;
            }
            if(!reg.test(phone)){
                layer.msg('请填写正确的手机号码',{icon:2});
                return false;
            }
            layer.load(1);
            $('#hongbao_submit').submit();
        });
        $('.J_dialog').bind('click',function(){
            var url = $(this).data('uri');
            layer.open({
                type: 2,
                title: false,
                area: ['500px', '400px'],
                shade: 0,
                closeBtn: 1,
                shadeClose: true,
                content:url
            });
        });
        $('#hongbao_submit').ajaxForm({success:complate,dataType:'json'});
        function complate(result){
            if(result.status == 1){
                layer.closeAll();
                layer.msg(result.msg,{icon:1});
                setTimeout(function(){$('#shade').hide();},3000);
                $('input[name="name"]').val('');
                $('input[name="phone"]').val('');
            } else {
                layer.msg(result.msg,{icon:2});
            }
        }
    })
</script>